/**
 * 通用API类型定义
 */

export interface UploadFileParams {
  file: File;
  type?: 'image' | 'document' | 'video' | 'audio';
  folder?: string;
}

export interface UploadFileResponse {
  url: string;
  filename: string;
  size: number;
  type: string;
  uploadedAt: string;
}

export interface ConfigItem {
  key: string;
  value: string;
  type: 'string' | 'number' | 'boolean' | 'json';
  description?: string;
  category?: string;
}

export interface SystemConfig {
  [key: string]: any;
}

export interface CaptchaResponse {
  captchaId: string;
  captchaImage: string;
  expiresIn: number;
}

export interface VerifyCaptchaParams {
  captchaId: string;
  captchaCode: string;
}

export interface SMSCodeParams {
  phone: string;
  type: 'register' | 'login' | 'reset_password' | 'change_phone';
  captchaId?: string;
  captchaCode?: string;
}

export interface SMSCodeResponse {
  success: boolean;
  message: string;
  expiresIn: number;
}

export interface VerifySMSCodeParams {
  phone: string;
  code: string;
  type: 'register' | 'login' | 'reset_password' | 'change_phone';
}

export interface RegionData {
  code: string;
  name: string;
  level: number;
  parentCode?: string;
  children?: RegionData[];
}

export interface DictItem {
  label: string;
  value: string | number;
  disabled?: boolean;
  children?: DictItem[];
}

export interface DictData {
  [key: string]: DictItem[];
}
